<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="./vue.js"></script>
</head>
<body>
  <div id="app">
    <home></home>
  </div>
  <script>
    let CommonTitle = {
      props:['title','arr'],   //properties  props 父向子 传入的数据列表
      template:`
        <div>
            这是标题
          <h2>
            {{ title }}
          </h2>  
          <ul>
              <li v-for="item in arr" :key="item">
                  {{item}}
              </li>
          </ul>
        </div>
      `
    }
    let Home = {
      template:`
        <div>
          <!--
            <common-title title="我是首页"></common-title>  
          -->
          <common-title :title="title" :arr="0"></common-title>  
          home页内容  
        </div>
      `,
      data(){
        return {
          title:"我是home页111"
        }
      },
      components:{
        CommonTitle
      }
    }
    let vm = new Vue({
      el:"#app",
      components:{
        Home
      }
    })
  </script>
</body>
</html>